package com.demo.utlis;

import com.demo.entity.Fruits;

import java.util.Map;

public class MyUtils {
    public static double getTotal(Map<Fruits,Integer> map) {
        double total = 0;
        for (Map.Entry<Fruits, Integer> entry : map.entrySet()) {
            total += (entry.getKey().getPrice() * entry.getKey().getDiscount() * entry.getValue());
        }
        return total;

    }
}
